home *** CD-ROM | disk | FTP | other *** search
/ Sony Community Place / BROWSER / APP / CHAT / CHATROOM.EXE / program files / Sony / Community Place Browser / world / chatroom / scripts / wall.java < prev   
Encoding:
Java Source  |  1996-12-12  |  1.5 KB  |  63 lines

  1. /*
  2.  * Copyright(C) 1996 Sony Corporation. All rights reserved.
  3.  */
  4.  
  5. import vrml.*;
  6. import vrml.field.*;
  7. import vrml.node.*;
  8. import java.util.*;
  9. import vs.*;
  10.  
  11. public class wall extends Script{
  12.     /* Node */
  13.     SFNode        WallNode;
  14.  
  15.     /* EventOut */
  16.     //SFBool        WallTimeSensorEnabled;
  17.     SFTime        WallTimeSensorStartTime;
  18.     //SFTime        WallTimeSensorStopTime;
  19.  
  20.     public void initialize() {
  21.         /* Node */
  22.         WallNode                = (SFNode) getField( "WallNode" );
  23.  
  24.         /* EventOut */
  25.         //WallTimeSensorEnabled        = (SFBool) getEventOut( "WallTimeSensorEnabled" );
  26.         WallTimeSensorStartTime        = (SFTime) getEventOut( "WallTimeSensorStartTime" );
  27.         //WallTimeSensorStopTime        = (SFTime) getEventOut( "WallTimeSensorStopTime" );
  28.     }
  29.  
  30.     public void processEvent(Event e) {
  31.         String name = e.getName () ;
  32.  
  33.         if(name.equals("WallTouchSensorIsActive")) {    WallTouchSensorIsActive(e);    }
  34.         if(name.equals("WallShareTouched")){            WallShareTouched(e);        }
  35.     }
  36.  
  37.     public void WallTouchSensorIsActive(Event e) {
  38.         double time = e.getTimeStamp();
  39.         ConstSFBool mouse_down = (ConstSFBool)e.getValue();
  40.     
  41.         if (mouse_down.getValue()) return;    /* mouseDown */
  42.         
  43.         WallStart( time );
  44.         Vscp.sendApplSpecificMsgWithDist( WallNode, "WallShareTouched", "void", Vscp.allClientsExceptMe );
  45.     }
  46.  
  47.     public void WallShareTouched(Event e) {
  48.         double time = e.getTimeStamp();
  49.  
  50.         WallStart( time );
  51.  
  52.     }
  53.  
  54.     public void WallStart ( double time ) {
  55.  
  56.         WallTimeSensorStartTime.setValue( time );
  57.     
  58.     }
  59.  
  60.  
  61. }
  62. 
  63.